<?php
/**
 * Created by PhpStorm.
 * User: Mak
 * Date: 2016/3/24 0024
 * Time: 16:59
 */

namespace Home\Model;
use Think\Model;

class ClassInfoModel extends Model{
    protected $tableName = "classinfo";


    // 得到所有班级表中的记录
    public function getList() {
        $ret = $this->order('cid asc')->select();
        return $ret;
    }

    // 根据某系部编号取得某系部的所有班级信息
    public function getDeptItem($did){
        $condition['did'] = $did;
        $ret = $this->where($condition)->select();
        return $ret;
    }

    // 根据班级编号取得班级信息
    public function getItem($cid){
        $condition['cid'] = $cid;
        $ret = $this->where($condition)->find();
        return $ret;
    }
}